home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / BORL_TIP / TI1000 / TI1255.ASC < prev    next >
Text File  |  1993-02-10  |  5KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Borland/Turbo Pascal                  NUMBER  :  1255
  9.   VERSION  :  All
  10.        OS  :  DOS, WIN
  11.      DATE  :  February 10, 1993                        PAGE  :  1/3
  12.  
  13.     TITLE  :  Printing the Run of a Program
  14.  
  15.  
  16.  
  17.  
  18.   Educators teaching structured programming in PASCAL often require
  19.   students to submit a printout of the "Run" of assigned programs.
  20.   The "Run" represents the output of the program as it normally
  21.   appears on screen.  In mainframe environments, printing the "Run"
  22.   is nothing unusual.  Time and access are often very limited in
  23.   academic computer rooms and such a printout can be useful when
  24.   correcting code off-line.
  25.  
  26.   The Integrated Development Environment of Turbo Pascal has no
  27.   provision for printing the "Run" of a program.  On a personal
  28.   computer, output may take a variety of forms; simple text,
  29.   graphics, sound etc.  Printing a "run" in the fashion of an
  30.   academic mainframe is only relevant to code producing simple text
  31.   as output.  More substantial programs involving color and
  32.   graphics must use other means to print the "run". Techniques
  33.   dealing with graphics and color are not addressed in this
  34.   document.
  35.  
  36.   Printing the Run Using the DOS Version of Turbo Pascal
  37.  
  38.   In DOS, the operating system is capable of echoing to printer
  39.   characters sent to the screen.  This feature only functions from
  40.   the DOS prompt and only for Turbo Pascal programs not using CRT
  41.   or GRAPH units.  The echoing function is toggled on and off with
  42.   the key sequence <CTRL - P>.
  43.  
  44.   1.   Set the destination of the compiler to disk via the
  45.          Compile|Destination menu selection.
  46.   2.   Compile the program.  Doing so will generate a .EXE file.
  47.   3.   Exit Turbo Pascal.
  48.   4.   Ensure your printer is on and on-line.
  49.   5.   At a DOS prompt, hold down the key marked <CTRL> and
  50.          press the letter "P". Then let up on both keys.
  51.   6.   Type the name of your program.  Do not include the three
  52.          letter extension.  For instance, the program TEST.PAS
  53.          is taken as just TEST. Screen and printer output will
  54.          occur simultaneously.
  55.   7.   When the program is done, hold down the key marked <CTRL>
  56.          and press the letter "L". Then let up on both keys.
  57.          Next hold down <CTRL> again and press the letter "P".
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Borland/Turbo Pascal                  NUMBER  :  1255
  75.   VERSION  :  All
  76.        OS  :  DOS, WIN
  77.      DATE  :  February 10, 1993                        PAGE  :  2/3
  78.  
  79.     TITLE  :  Printing the Run of a Program
  80.  
  81.  
  82.  
  83.  
  84.          Let up on both keys.
  85.  
  86.   Printing the Run Using the Windows Version of Turbo Pascal
  87.  
  88.   Turbo Pascal for Windows is not ideally suited for introductory
  89.   Computer Science coursework.  Such coursework normally relies on
  90.   some terminal-type interface being involved.  Windows by its very
  91.   nature suspends all terminal-like devices available when running
  92.   DOS alone.  It is designed to function exclusively in an event-
  93.   driven, graphical environment.  Display functions are provided by
  94.   Windows and not by Turbo Pascal.  Hence, standard PASCAL
  95.   statements such as Write and Writeln do not function with the
  96.   screen display as they do with the DOS version. For Computer
  97.   Science coursework, it is strongly recommended that the DOS
  98.   version of Turbo Pascal be used.
  99.  
  100.   A unit called WinCRT ships with Turbo Pascal for Windows.  This
  101.   unit causes an output window to be displayed when the statements
  102.   Write, Writeln, Read, or Readln are used.  It mimics the function
  103.   of a terminal device and serves as a temporary aid for those
  104.   learning to use Windows API functions.  This unit allows some
  105.   traditional programming to be done but provides nothing to
  106.   "print" a run.
  107.  
  108.   If printing the output of a program in Windows is absolutely
  109.   required, follow these steps.
  110.  
  111.   1.   Run the program.
  112.   2.   Enlarge the output window to fill the entire screen.
  113.   3.   Press the <Print Screen> key.  The <Print Screen> key
  114.        will copy the contents of the Windows Desktop to the
  115.        clipboard.
  116.   4.   Bring up the Windows Paintbrush program.
  117.   5.   Create an image large enough to hold the most of the
  118.          screen.  See Microsoft Windows documentation for
  119.          details.
  120.   6.   Using the Edit|Paste command, copy the contents of the
  121.          clipboard into the image used by PaintBrush.
  122.   7.   To print, use the PaintBrush's printing commands as
  123.          detailed in the Microsoft Windows documentation.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Borland/Turbo Pascal                  NUMBER  :  1255
  141.   VERSION  :  All
  142.        OS  :  DOS, WIN
  143.      DATE  :  February 10, 1993                        PAGE  :  3/3
  144.  
  145.     TITLE  :  Printing the Run of a Program
  146.  
  147.  
  148.  
  149.  
  150.   This method will only print the visible portion of the Window.
  151.   If program output has scrolled from view, it may need to be
  152.   scrolled back into view and the screen again copied to the
  153.   clipboard, copied from there to Paintbrush and then printed.  For
  154.   programs with significant output, this process may need to be
  155.   repeated many times.
  156.  
  157.   DISCLAIMER: You have the right to use this technical information
  158.   subject to the terms of the No-Nonsense License Statement that
  159.   you received with the Borland product to which this information
  160.   pertains.
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.